package TEST;


import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;

import shared.Messages.QuestionMessage;

import Server.Game.Questions.Answer;
import Server.Game.Questions.Question;

public class QuestionMessageTest {
	QuestionMessage m;
	
	@Before
	public void setUp() throws Exception {
		Question question = new Question();
		question.setContent("1.Kysimus");
		question.addAnswer(new Answer("Vastus1", true));
		question.addAnswer(new Answer("Vastus2", true));
		m = new QuestionMessage(question, 2, 1, 100, 120);		
	}
	
	@Test
	public void QuestionMessageQuestionContentTest(){
		assertEquals("1.Kysimus",m.questionContent);
	}
	
	@Test
	public void QuestionMessageAnswersContentTest(){
		assertTrue(m.answersContent.contains("Vastus1"));
		assertTrue(m.answersContent.contains("Vastus2"));
	}
	
	@Test
	public void QuestionMessageOtherInfoTest(){	
		assertEquals(2,m.GameNo);
		assertEquals(1,m.playerId);
		assertEquals(100,m.points1);
		assertEquals(120,m.points2);
	}

}
